package com.bawei.live.view.adapter

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.bawei.common.entity.SimpleVideoEntity
import com.bawei.image.ImgOptions
import com.bawei.image.LoadImageUtil
import com.bawei.live.databinding.ItemHotLiveBinding
import com.bawei.live.databinding.PopleItemListBinding
import com.bumptech.glide.Glide

/**
 * @Author: Lin Liu
 * @CreateTime: 2025年02月18日 13:37:48
 * @Description:
 */
class HeadPopoleAdapter constructor(private val list : List<Int>) : RecyclerView.Adapter<HeadPopoleAdapter.ItemViewHolder>(){

    inner class ItemViewHolder(val dataBinding: PopleItemListBinding) : RecyclerView.ViewHolder(dataBinding.root)

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ItemViewHolder {
        return ItemViewHolder(PopleItemListBinding.inflate(LayoutInflater.from(parent.context),parent,false))
    }

    override fun getItemCount(): Int = list.size

    override fun onBindViewHolder(holder: ItemViewHolder, position: Int) {

        var entity = list[position]

        LoadImageUtil.loadRes(
            holder.dataBinding.root.context,
            entity,
            holder.dataBinding.headPople,
            ImgOptions.Builder.isCircle(true).build()
        )
    }


}